import numpy as np

if __name__=='__main__':
    print(np.__version__)

    lst = [1,2,3]

    lst[0] = "Linear Algebra"

    print(lst)

    vec = np.array([1,2,3])

    print(vec)
    # vec[0] =  "Linear Algebra"

    print(np.zeros(5))
    print(np.ones(5))
    print(np.full(5,666))

    #np基本属性
    print(vec.size)
    print(len(vec))

    #最后一个
    print(vec[-1])

    #切片语法，前两位
    print(vec[0:2])

    print(type(vec))

    vec2 = np.array([4,5,6])

    print(vec + vec2)
    print(vec - vec2)

    print(vec*2)

    # 逐个元素想乘
    print(vec*vec2)

    print(vec.dot(vec2))

    normal = np.linalg.norm(vec)

    print(vec / normal)